翻訳と辞書
Words near each other
・ Spain at the 2013 Mediterranean Games
・ Spain at the 2013 UCI Road World Championships
・ Spain at the 2013 World Aquatics Championships
・ Spain at the 2013 World Championships in Athletics
・ Spain at the 2014 European Athletics Championships
・ Spaghetti Funk
・ Spaghetti House
・ Spaghetti House siege
・ Spaghetti Junction
・ Spaghetti Junction (disambiguation)
・ Spaghetti Junction, Kentucky
・ Spaghetti Nightmares
・ Spaghetti plot
・ Spaghetti Records
・ Spaghetti Red
Spaghetti sort
・ Spaghetti squash
・ Spaghetti strap
・ Spaghetti taco
・ Spaghetti Vabune!
・ Spaghetti Warehouse
・ Spaghetti Western
・ Spaghetti Western and Meatballs
・ Spaghetti Western Orchestra
・ Spaghetti with meatballs
・ Spaghetti worm
・ Spaghetti-tree hoax
・ Spaghettieis
・ Spaghettification
・ SpaghettiOs


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Spaghetti sort : ウィキペディア英語版
Spaghetti sort

Spaghetti sort is a linear-time, analog algorithm for sorting a sequence of items, by Alexander Dewdney in his column, ''Scientific American''. This algorithm sorts a sequence of items requiring O(''n'') stack space in a stable manner. It requires a parallel processor.
==Algorithm==
For simplicity, assume we are sorting a list of natural numbers. The sorting method is illustrated using uncooked rods of spaghetti:
# For each number ''x'' in the list, obtain a rod of length ''x''. (One practical way of choosing the unit is to let the largest number ''m'' in the list correspond to one full rod of spaghetti. In this case, the full rod equals ''m'' spaghetti units. To get a rod of length ''x'', break a rod in two so that one piece is of length ''x'' units; discard the other piece.)
#Once you have all your spaghetti rods, take them loosely in your fist and lower them to the table, so that they all stand upright, resting on the table surface. Now, for each rod, lower your other hand from above until it meets with a rod—this one is clearly the longest. Remove this rod and insert it into the front of the (initially empty) output list (or equivalently, place it in the last unused slot of the output array). Repeat until all rods have been removed.

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Spaghetti sort」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.